import SimpleObjectPool from "../Pool/SimpleObjectPool";

import MathTool from "../MathTool";
import MsgDispatcher, { MsgType } from "../MsgDispatcher";
import AStarMapManager from "../../AStart/AStarMapManager";


export enum GameToolType
{
    BalckHole,
    BloodPackage,
    AttackPackage,
    ProtectionCover,
}


export default class  GameToolManager 
{

    private static m_instance;
    public static GetInstance():GameToolManager
    {
        if(this.m_instance==null)
        {
            this.m_instance=new GameToolManager();
        }
        return this.m_instance;
    }


    private m_playerIndexYmin=5;
    private m_PlayerIndexYmax=8;

    private m_enemyIndexYmin=13;
    private m_enemyIndexYmax=16;

    private m_currentScene:Laya.Scene3D=null;
    private m_astarMap:AStarMapManager=null;
    private m_allPrefab:Laya.Sprite3D=null;


    private m_toolcount=0;
    private m_buffcount=0;
    private m_timer=0;

    constructor()
    {

    }

    Init(scene:Laya.Scene3D)
    {
        this.m_currentScene=scene;
        this.InitGameToolPool();
    }


    StartInstanceTool()
    { 
        this.m_timer=0;
        Laya.timer.loop(5000,this,this.TimeLoopInvoke)
    }






    InitGameToolPool()
    {
       
    }


    public InstanceGameTool(toolType:GameToolType)
    {
        let gametool=null;
        return gametool;
    }


    TimeLoopInvoke()
    {
        this.m_timer+=5;
      
        if (this.m_timer%5==0) 
        {
            console.log("TimeLoopInvoke BlackHole "+this.m_buffcount);
           if (this.m_buffcount<2) 
           {
             let index=MathTool.GetRandomInt(0,3);
             switch (index) 
             {

             }
              
           }
        }

        if (this.m_timer%20==0) 
        {   
           // console.log("InstanceBlackHole "+this.m_toolcount);
            if (this.m_toolcount<1) 
            {
            }
        }
    }



    
  



}